package com.zgcs.sequence.net.in;

import java.io.Serializable;
import java.util.ArrayList;

import com.zscg.sequence.data.Room;

public class RoomListPackage extends InPackage implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7873157212213941905L;
	public ArrayList<Room> roomList;
	public int count;

	public RoomListPackage(String result) {
		super(result);
	}

	@Override
	public void parserSelf() {
		count = Integer.parseInt(resultSpl[2]);
		if (count > 0) {
			roomList = new ArrayList<Room>();
			Room room;
			for (int i = 3; i < resultSpl.length; i += 6) {
				room = new Room();
				room.roomId = Integer.parseInt(resultSpl[i]);
				room.keywords = resultSpl[i + 1];
				room.title = resultSpl[i + 2];
				room.desc = resultSpl[i + 3];
				room.personNum = Integer.parseInt(resultSpl[i + 4]);
				room.maxNum = Integer.parseInt(resultSpl[i + 5]);

				roomList.add(room);
			}
		}
	}
	
}
